from typing import Any
from typing import Callable
from typing import Literal
from typing import Optional
from typing import Sequence
from typing import Tuple
from typing import Type
from typing import TypeVar

from gi.repository import Gio
from gi.repository import GLib
from gi.repository import GObject
from gi.repository import HarfBuzz

ANALYSIS_FLAG_CENTERED_BASELINE: int = 1
ANALYSIS_FLAG_IS_ELLIPSIS: int = 2
ANALYSIS_FLAG_NEED_HYPHEN: int = 4
ATTR_INDEX_FROM_TEXT_BEGINNING: int = 0
ATTR_INDEX_TO_TEXT_END: int = 4294967295
GLYPH_EMPTY: int = 268435455
GLYPH_INVALID_INPUT: int = 4294967295
GLYPH_UNKNOWN_FLAG: int = 268435456
SCALE: int = 1024
VERSION_MAJOR: int = 1
VERSION_MICRO: int = 0
VERSION_MINOR: int = 54
VERSION_STRING: str = "1.54.0"
_introspection_module = ...  # FIXME Constant
_lock = ...  # FIXME Constant
_namespace: str = "Pango"
_overrides_module = ...  # FIXME Constant
_version: str = "1.0"

def attr_allow_breaks_new(allow_breaks: bool) -> Attribute: ...
def attr_background_alpha_new(alpha: int) -> Attribute: ...
def attr_background_new(red: int, green: int, blue: int) -> Attribute: ...
def attr_baseline_shift_new(shift: int) -> Attribute: ...
def attr_break(
    text: str, length: int, attr_list: AttrList, offset: int, attrs: Sequence[LogAttr]
) -> None: ...
def attr_fallback_new(enable_fallback: bool) -> Attribute: ...
def attr_family_new(family: str) -> Attribute: ...
def attr_font_desc_new(desc: FontDescription) -> Attribute: ...
def attr_font_features_new(features: str) -> Attribute: ...
def attr_font_scale_new(scale: FontScale) -> Attribute: ...
def attr_foreground_alpha_new(alpha: int) -> Attribute: ...
def attr_foreground_new(red: int, green: int, blue: int) -> Attribute: ...
def attr_gravity_hint_new(hint: GravityHint) -> Attribute: ...
def attr_gravity_new(gravity: Gravity) -> Attribute: ...
def attr_insert_hyphens_new(insert_hyphens: bool) -> Attribute: ...
def attr_language_new(language: Language) -> Attribute: ...
def attr_letter_spacing_new(letter_spacing: int) -> Attribute: ...
def attr_line_height_new(factor: float) -> Attribute: ...
def attr_line_height_new_absolute(height: int) -> Attribute: ...
def attr_list_from_string(text: str) -> Optional[AttrList]: ...
def attr_overline_color_new(red: int, green: int, blue: int) -> Attribute: ...
def attr_overline_new(overline: Overline) -> Attribute: ...
def attr_rise_new(rise: int) -> Attribute: ...
def attr_scale_new(scale_factor: float) -> Attribute: ...
def attr_sentence_new() -> Attribute: ...
def attr_shape_new(ink_rect: Rectangle, logical_rect: Rectangle) -> Attribute: ...
def attr_shape_new_with_data(
    ink_rect: Rectangle,
    logical_rect: Rectangle,
    data: None,
    copy_func: Optional[Callable[..., None]] = None,
    destroy_func: Optional[Callable[[None], None]] = None,
) -> Attribute: ...
def attr_show_new(flags: ShowFlags) -> Attribute: ...
def attr_size_new(size: int) -> Attribute: ...
def attr_size_new_absolute(size: int) -> Attribute: ...
def attr_stretch_new(stretch: Stretch) -> Attribute: ...
def attr_strikethrough_color_new(red: int, green: int, blue: int) -> Attribute: ...
def attr_strikethrough_new(strikethrough: bool) -> Attribute: ...
def attr_style_new(style: Style) -> Attribute: ...
def attr_text_transform_new(transform: TextTransform) -> Attribute: ...
def attr_type_get_name(type: AttrType) -> Optional[str]: ...
def attr_type_register(name: str) -> AttrType: ...
def attr_underline_color_new(red: int, green: int, blue: int) -> Attribute: ...
def attr_underline_new(underline: Underline) -> Attribute: ...
def attr_variant_new(variant: Variant) -> Attribute: ...
def attr_weight_new(weight: Weight) -> Attribute: ...
def attr_word_new() -> Attribute: ...
def bidi_type_for_unichar(ch: str) -> BidiType: ...
def break_(
    text: str, length: int, analysis: Analysis, attrs: Sequence[LogAttr]
) -> None: ...
def default_break(
    text: str, length: int, analysis: Optional[Analysis], attrs: LogAttr, attrs_len: int
) -> None: ...
def extents_to_pixels(
    inclusive: Optional[Rectangle] = None, nearest: Optional[Rectangle] = None
) -> None: ...
def find_base_dir(text: str, length: int) -> Direction: ...
def find_paragraph_boundary(text: str, length: int) -> Tuple[int, int]: ...
def font_description_from_string(str: str) -> FontDescription: ...
def get_log_attrs(
    text: str, length: int, level: int, language: Language, attrs: Sequence[LogAttr]
) -> None: ...
def get_mirror_char(ch: str, mirrored_ch: str) -> bool: ...
def gravity_get_for_matrix(matrix: Optional[Matrix] = None) -> Gravity: ...
def gravity_get_for_script(
    script: Script, base_gravity: Gravity, hint: GravityHint
) -> Gravity: ...
def gravity_get_for_script_and_width(
    script: Script, wide: bool, base_gravity: Gravity, hint: GravityHint
) -> Gravity: ...
def gravity_to_rotation(gravity: Gravity) -> float: ...
def is_zero_width(ch: str) -> bool: ...
def itemize(
    context: Context,
    text: str,
    start_index: int,
    length: int,
    attrs: AttrList,
    cached_iter: Optional[AttrIterator] = None,
) -> list[Item]: ...
def itemize_with_base_dir(
    context: Context,
    base_dir: Direction,
    text: str,
    start_index: int,
    length: int,
    attrs: AttrList,
    cached_iter: Optional[AttrIterator] = None,
) -> list[Item]: ...
def language_from_string(language: Optional[str] = None) -> Optional[Language]: ...
def language_get_default() -> Language: ...
def language_get_preferred() -> Optional[list[Language]]: ...
def layout_deserialize_error_quark() -> int: ...
def log2vis_get_embedding_levels(
    text: str, length: int, pbase_dir: Direction
) -> int: ...
def markup_parser_finish(
    context: GLib.MarkupParseContext,
) -> Tuple[bool, AttrList, str, str]: ...
def markup_parser_new(accel_marker: str) -> GLib.MarkupParseContext: ...
def parse_enum(type: Type, str: Optional[str], warn: bool) -> Tuple[bool, int, str]: ...
def parse_markup(
    markup_text: str, length: int, accel_marker: str
) -> Tuple[bool, AttrList, str, str]: ...
def parse_stretch(str: str, warn: bool) -> Tuple[bool, Stretch]: ...
def parse_style(str: str, warn: bool) -> Tuple[bool, Style]: ...
def parse_variant(str: str, warn: bool) -> Tuple[bool, Variant]: ...
def parse_weight(str: str, warn: bool) -> Tuple[bool, Weight]: ...
def quantize_line_geometry() -> Tuple[int, int]: ...
def read_line(stream: None, str: GLib.String) -> int: ...
def reorder_items(items: list[Item]) -> list[Item]: ...
def scan_int() -> Tuple[bool, str, int]: ...
def scan_string(out: GLib.String) -> Tuple[bool, str]: ...
def scan_word(out: GLib.String) -> Tuple[bool, str]: ...
def script_for_unichar(ch: str) -> Script: ...
def script_get_sample_language(script: Script) -> Optional[Language]: ...
def shape(text: str, length: int, analysis: Analysis, glyphs: GlyphString) -> None: ...
def shape_full(
    item_text: str,
    item_length: int,
    paragraph_text: Optional[str],
    paragraph_length: int,
    analysis: Analysis,
    glyphs: GlyphString,
) -> None: ...
def shape_item(
    item: Item,
    paragraph_text: Optional[str],
    paragraph_length: int,
    log_attrs: Optional[LogAttr],
    glyphs: GlyphString,
    flags: ShapeFlags,
) -> None: ...
def shape_with_flags(
    item_text: str,
    item_length: int,
    paragraph_text: Optional[str],
    paragraph_length: int,
    analysis: Analysis,
    glyphs: GlyphString,
    flags: ShapeFlags,
) -> None: ...
def skip_space() -> Tuple[bool, str]: ...
def split_file_list(str: str) -> list[str]: ...
def tab_array_from_string(text: str) -> Optional[TabArray]: ...
def tailor_break(
    text: str, length: int, analysis: Analysis, offset: int, attrs: Sequence[LogAttr]
) -> None: ...
def trim_string(str: str) -> str: ...
def unichar_direction(ch: str) -> Direction: ...
def units_from_double(d: float) -> int: ...
def units_to_double(i: int) -> float: ...
def version() -> int: ...
def version_check(
    required_major: int, required_minor: int, required_micro: int
) -> Optional[str]: ...
def version_string() -> str: ...

class Analysis(GObject.GPointer):
    """
    :Constructors:

    ::

        Analysis()
    """

    shape_engine: None = ...
    lang_engine: None = ...
    font: Font = ...
    level: int = ...
    gravity: int = ...
    flags: int = ...
    script: int = ...
    language: Language = ...
    extra_attrs: list[None] = ...

class AttrClass(GObject.GPointer):
    """
    :Constructors:

    ::

        AttrClass()
    """

    type: AttrType = ...
    copy: Callable[[Attribute], Attribute] = ...
    destroy: Callable[[Attribute], None] = ...
    equal: Callable[[Attribute, Attribute], bool] = ...

class AttrColor(GObject.GPointer):
    """
    :Constructors:

    ::

        AttrColor()
    """

    attr: Attribute = ...
    color: Color = ...

class AttrFloat(GObject.GPointer):
    """
    :Constructors:

    ::

        AttrFloat()
    """

    attr: Attribute = ...
    value: float = ...

class AttrFontDesc(GObject.GPointer):
    """
    :Constructors:

    ::

        AttrFontDesc()
    """

    attr: Attribute = ...
    desc: FontDescription = ...
    @staticmethod
    def new(desc: FontDescription) -> Attribute: ...

class AttrFontFeatures(GObject.GPointer):
    """
    :Constructors:

    ::

        AttrFontFeatures()
    """

    attr: Attribute = ...
    features: str = ...
    @staticmethod
    def new(features: str) -> Attribute: ...

class AttrInt(GObject.GPointer):
    """
    :Constructors:

    ::

        AttrInt()
    """

    attr: Attribute = ...
    value: int = ...

class AttrIterator(GObject.GBoxed):
    def copy(self) -> AttrIterator: ...
    def destroy(self) -> None: ...
    def get(self, type: AttrType) -> Optional[Attribute]: ...
    def get_attrs(self) -> list[Attribute]: ...
    def get_font(self, desc: FontDescription) -> Tuple[Language, list[Attribute]]: ...
    def next(self) -> bool: ...
    def range(self) -> Tuple[int, int]: ...

class AttrLanguage(GObject.GPointer):
    """
    :Constructors:

    ::

        AttrLanguage()
    """

    attr: Attribute = ...
    value: Language = ...
    @staticmethod
    def new(language: Language) -> Attribute: ...

class AttrList(GObject.GBoxed):
    """
    :Constructors:

    ::

        new() -> Pango.AttrList
    """

    def change(self, attr: Attribute) -> None: ...
    def copy(self) -> Optional[AttrList]: ...
    def equal(self, other_list: AttrList) -> bool: ...
    def filter(self, func: Callable[..., bool], *data: Any) -> Optional[AttrList]: ...
    @staticmethod
    def from_string(text: str) -> Optional[AttrList]: ...
    def get_attributes(self) -> list[Attribute]: ...
    def get_iterator(self) -> AttrIterator: ...
    def insert(self, attr: Attribute) -> None: ...
    def insert_before(self, attr: Attribute) -> None: ...
    @classmethod
    def new(cls) -> AttrList: ...
    def ref(self) -> AttrList: ...
    def splice(self, other: AttrList, pos: int, len: int) -> None: ...
    def to_string(self) -> str: ...
    def unref(self) -> None: ...
    def update(self, pos: int, remove: int, add: int) -> None: ...

class AttrShape(GObject.GPointer):
    """
    :Constructors:

    ::

        AttrShape()
    """

    attr: Attribute = ...
    ink_rect: Rectangle = ...
    logical_rect: Rectangle = ...
    data: None = ...
    copy_func: Callable[..., None] = ...
    destroy_func: Callable[[None], None] = ...
    @staticmethod
    def new(ink_rect: Rectangle, logical_rect: Rectangle) -> Attribute: ...
    @staticmethod
    def new_with_data(
        ink_rect: Rectangle,
        logical_rect: Rectangle,
        data: None,
        copy_func: Optional[Callable[..., None]] = None,
        destroy_func: Optional[Callable[[None], None]] = None,
    ) -> Attribute: ...

class AttrSize(GObject.GPointer):
    """
    :Constructors:

    ::

        AttrSize()
    """

    attr: Attribute = ...
    size: int = ...
    absolute: int = ...
    @staticmethod
    def new(size: int) -> Attribute: ...
    @staticmethod
    def new_absolute(size: int) -> Attribute: ...

class AttrString(GObject.GPointer):
    """
    :Constructors:

    ::

        AttrString()
    """

    attr: Attribute = ...
    value: str = ...

class Attribute(GObject.GBoxed):
    """
    :Constructors:

    ::

        Attribute()
    """

    klass: AttrClass = ...
    start_index: int = ...
    end_index: int = ...
    def as_color(self) -> Optional[AttrColor]: ...
    def as_float(self) -> Optional[AttrFloat]: ...
    def as_font_desc(self) -> Optional[AttrFontDesc]: ...
    def as_font_features(self) -> Optional[AttrFontFeatures]: ...
    def as_int(self) -> Optional[AttrInt]: ...
    def as_language(self) -> Optional[AttrLanguage]: ...
    def as_shape(self) -> Optional[AttrShape]: ...
    def as_size(self) -> Optional[AttrSize]: ...
    def as_string(self) -> Optional[AttrString]: ...
    def copy(self) -> Attribute: ...
    def destroy(self) -> None: ...
    def equal(self, attr2: Attribute) -> bool: ...
    def init(self, klass: AttrClass) -> None: ...

class Color(GObject.GBoxed):
    """
    :Constructors:

    ::

        Color()
    """

    red: int = ...
    green: int = ...
    blue: int = ...
    def copy(self) -> Optional[Color]: ...
    def free(self) -> None: ...
    def parse(self, spec: str) -> bool: ...
    def parse_with_alpha(self, spec: str) -> Tuple[bool, int]: ...
    def to_string(self) -> str: ...

class Context(GObject.Object):
    """
    :Constructors:

    ::

        Context(**properties)
        new() -> Pango.Context

    Object PangoContext

    Signals from GObject:
      notify (GParam)
    """

    def changed(self) -> None: ...
    def get_base_dir(self) -> Direction: ...
    def get_base_gravity(self) -> Gravity: ...
    def get_font_description(self) -> Optional[FontDescription]: ...
    def get_font_map(self) -> Optional[FontMap]: ...
    def get_gravity(self) -> Gravity: ...
    def get_gravity_hint(self) -> GravityHint: ...
    def get_language(self) -> Language: ...
    def get_matrix(self) -> Optional[Matrix]: ...
    def get_metrics(
        self,
        desc: Optional[FontDescription] = None,
        language: Optional[Language] = None,
    ) -> FontMetrics: ...
    def get_round_glyph_positions(self) -> bool: ...
    def get_serial(self) -> int: ...
    def list_families(self) -> list[FontFamily]: ...
    def load_font(self, desc: FontDescription) -> Optional[Font]: ...
    def load_fontset(
        self, desc: FontDescription, language: Language
    ) -> Optional[Fontset]: ...
    @classmethod
    def new(cls) -> Context: ...
    def set_base_dir(self, direction: Direction) -> None: ...
    def set_base_gravity(self, gravity: Gravity) -> None: ...
    def set_font_description(self, desc: Optional[FontDescription] = None) -> None: ...
    def set_font_map(self, font_map: Optional[FontMap] = None) -> None: ...
    def set_gravity_hint(self, hint: GravityHint) -> None: ...
    def set_language(self, language: Optional[Language] = None) -> None: ...
    def set_matrix(self, matrix: Optional[Matrix] = None) -> None: ...
    def set_round_glyph_positions(self, round_positions: bool) -> None: ...

class ContextClass(GObject.GPointer): ...

class Coverage(GObject.Object):
    """
    :Constructors:

    ::

        Coverage(**properties)
        new() -> Pango.Coverage

    Object PangoCoverage

    Signals from GObject:
      notify (GParam)
    """

    def copy(self) -> Coverage: ...
    @staticmethod
    def from_bytes(bytes: Sequence[int]) -> Optional[Coverage]: ...
    def get(self, index_: int) -> CoverageLevel: ...
    def max(self, other: Coverage) -> None: ...
    @classmethod
    def new(cls) -> Coverage: ...
    def ref(self) -> Coverage: ...
    def set(self, index_: int, level: CoverageLevel) -> None: ...
    def to_bytes(self) -> bytes: ...
    def unref(self) -> None: ...

class Font(GObject.Object):
    """
    :Constructors:

    ::

        Font(**properties)

    Object PangoFont

    Signals from GObject:
      notify (GParam)
    """

    parent_instance: GObject.Object = ...
    def describe(self) -> FontDescription: ...
    def describe_with_absolute_size(self) -> FontDescription: ...
    @staticmethod
    def descriptions_free(
        descs: Optional[Sequence[FontDescription]] = None,
    ) -> None: ...
    @staticmethod
    def deserialize(context: Context, bytes: GLib.Bytes) -> Optional[Font]: ...
    def do_create_hb_font(self) -> HarfBuzz.font_t: ...
    def do_describe(self) -> FontDescription: ...
    def do_describe_absolute(self) -> FontDescription: ...
    def do_get_coverage(self, language: Language) -> Coverage: ...
    def do_get_features(self) -> Tuple[list[HarfBuzz.feature_t], int]: ...
    def do_get_font_map(self) -> Optional[FontMap]: ...
    def do_get_glyph_extents(self, glyph: int) -> Tuple[Rectangle, Rectangle]: ...
    def do_get_metrics(self, language: Optional[Language] = None) -> FontMetrics: ...
    def get_coverage(self, language: Language) -> Coverage: ...
    def get_face(self) -> FontFace: ...
    def get_features(self) -> Tuple[list[HarfBuzz.feature_t], int]: ...
    def get_font_map(self) -> Optional[FontMap]: ...
    def get_glyph_extents(self, glyph: int) -> Tuple[Rectangle, Rectangle]: ...
    def get_languages(self) -> Optional[list[Language]]: ...
    def get_metrics(self, language: Optional[Language] = None) -> FontMetrics: ...
    def has_char(self, wc: str) -> bool: ...
    def serialize(self) -> GLib.Bytes: ...

class FontClass(GObject.GPointer):
    """
    :Constructors:

    ::

        FontClass()
    """

    parent_class: GObject.ObjectClass = ...
    describe: Callable[[Font], FontDescription] = ...
    get_coverage: Callable[[Font, Language], Coverage] = ...
    get_glyph_extents: Callable[[Optional[Font], int], Tuple[Rectangle, Rectangle]] = (
        ...
    )
    get_metrics: Callable[[Optional[Font], Optional[Language]], FontMetrics] = ...
    get_font_map: Callable[[Optional[Font]], Optional[FontMap]] = ...
    describe_absolute: Callable[[Font], FontDescription] = ...
    get_features: Callable[[Font], Tuple[list[HarfBuzz.feature_t], int]] = ...
    create_hb_font: Callable[[Font], HarfBuzz.font_t] = ...

class FontDescription(GObject.GBoxed):
    """
    :Constructors:

    ::

        new() -> Pango.FontDescription
    """

    def better_match(
        self, old_match: Optional[FontDescription], new_match: FontDescription
    ) -> bool: ...
    def copy(self) -> Optional[FontDescription]: ...
    def copy_static(self) -> Optional[FontDescription]: ...
    def equal(self, desc2: FontDescription) -> bool: ...
    def free(self) -> None: ...
    @staticmethod
    def from_string(str: str) -> FontDescription: ...
    def get_family(self) -> Optional[str]: ...
    def get_gravity(self) -> Gravity: ...
    def get_set_fields(self) -> FontMask: ...
    def get_size(self) -> int: ...
    def get_size_is_absolute(self) -> bool: ...
    def get_stretch(self) -> Stretch: ...
    def get_style(self) -> Style: ...
    def get_variant(self) -> Variant: ...
    def get_variations(self) -> Optional[str]: ...
    def get_weight(self) -> Weight: ...
    def hash(self) -> int: ...
    def merge(
        self, desc_to_merge: Optional[FontDescription], replace_existing: bool
    ) -> None: ...
    def merge_static(
        self, desc_to_merge: FontDescription, replace_existing: bool
    ) -> None: ...
    @classmethod
    def new(cls) -> FontDescription: ...
    def set_absolute_size(self, size: float) -> None: ...
    def set_family(self, family: str) -> None: ...
    def set_family_static(self, family: str) -> None: ...
    def set_gravity(self, gravity: Gravity) -> None: ...
    def set_size(self, size: int) -> None: ...
    def set_stretch(self, stretch: Stretch) -> None: ...
    def set_style(self, style: Style) -> None: ...
    def set_variant(self, variant: Variant) -> None: ...
    def set_variations(self, variations: Optional[str] = None) -> None: ...
    def set_variations_static(self, variations: str) -> None: ...
    def set_weight(self, weight: Weight) -> None: ...
    def to_filename(self) -> Optional[str]: ...
    def to_string(self) -> str: ...
    def unset_fields(self, to_unset: FontMask) -> None: ...

class FontFace(GObject.Object):
    """
    :Constructors:

    ::

        FontFace(**properties)

    Object PangoFontFace

    Signals from GObject:
      notify (GParam)
    """

    parent_instance: GObject.Object = ...
    def describe(self) -> FontDescription: ...
    def do_describe(self) -> FontDescription: ...
    def do_get_face_name(self) -> str: ...
    def do_get_family(self) -> FontFamily: ...
    def do_is_synthesized(self) -> bool: ...
    def do_list_sizes(self) -> list[int]: ...
    def get_face_name(self) -> str: ...
    def get_family(self) -> FontFamily: ...
    def is_synthesized(self) -> bool: ...
    def list_sizes(self) -> list[int]: ...

class FontFaceClass(GObject.GPointer):
    """
    :Constructors:

    ::

        FontFaceClass()
    """

    parent_class: GObject.ObjectClass = ...
    get_face_name: Callable[[FontFace], str] = ...
    describe: Callable[[FontFace], FontDescription] = ...
    list_sizes: Callable[[FontFace], list[int]] = ...
    is_synthesized: Callable[[FontFace], bool] = ...
    get_family: Callable[[FontFace], FontFamily] = ...
    _pango_reserved3: None = ...
    _pango_reserved4: None = ...

class FontFamily(GObject.Object, Gio.ListModel):
    """
    :Constructors:

    ::

        FontFamily(**properties)

    Object PangoFontFamily

    Properties from PangoFontFamily:
      item-type -> GType:

      n-items -> guint:

      name -> gchararray:

      is-monospace -> gboolean:

      is-variable -> gboolean:


    Signals from GListModel:
      items-changed (guint, guint, guint)

    Signals from GObject:
      notify (GParam)
    """

    class Props:
        is_monospace: bool
        is_variable: bool
        item_type: Type
        n_items: int
        name: str

    props: Props = ...
    parent_instance: GObject.Object = ...
    def do_get_face(self, name: Optional[str] = None) -> Optional[FontFace]: ...
    def do_get_name(self) -> str: ...
    def do_is_monospace(self) -> bool: ...
    def do_is_variable(self) -> bool: ...
    def do_list_faces(self) -> list[FontFace]: ...
    def get_face(self, name: Optional[str] = None) -> Optional[FontFace]: ...
    def get_name(self) -> str: ...
    def is_monospace(self) -> bool: ...
    def is_variable(self) -> bool: ...
    def list_faces(self) -> list[FontFace]: ...

class FontFamilyClass(GObject.GPointer):
    """
    :Constructors:

    ::

        FontFamilyClass()
    """

    parent_class: GObject.ObjectClass = ...
    list_faces: Callable[[FontFamily], list[FontFace]] = ...
    get_name: Callable[[FontFamily], str] = ...
    is_monospace: Callable[[FontFamily], bool] = ...
    is_variable: Callable[[FontFamily], bool] = ...
    get_face: Callable[[FontFamily, Optional[str]], Optional[FontFace]] = ...
    _pango_reserved2: None = ...

class FontMap(GObject.Object, Gio.ListModel):
    """
    :Constructors:

    ::

        FontMap(**properties)

    Object PangoFontMap

    Properties from PangoFontMap:
      item-type -> GType:

      n-items -> guint:


    Signals from GListModel:
      items-changed (guint, guint, guint)

    Signals from GObject:
      notify (GParam)
    """

    class Props:
        item_type: Type
        n_items: int

    props: Props = ...
    parent_instance: GObject.Object = ...
    def changed(self) -> None: ...
    def create_context(self) -> Context: ...
    def do_changed(self) -> None: ...
    def do_get_family(self, name: str) -> FontFamily: ...
    def do_get_serial(self) -> int: ...
    def do_list_families(self) -> list[FontFamily]: ...
    def do_load_font(
        self, context: Context, desc: FontDescription
    ) -> Optional[Font]: ...
    def do_load_fontset(
        self, context: Context, desc: FontDescription, language: Language
    ) -> Optional[Fontset]: ...
    def get_family(self, name: str) -> FontFamily: ...
    def get_serial(self) -> int: ...
    def list_families(self) -> list[FontFamily]: ...
    def load_font(self, context: Context, desc: FontDescription) -> Optional[Font]: ...
    def load_fontset(
        self, context: Context, desc: FontDescription, language: Language
    ) -> Optional[Fontset]: ...
    def reload_font(
        self,
        font: Font,
        scale: float,
        context: Optional[Context] = None,
        variations: Optional[str] = None,
    ) -> Font: ...

class FontMapClass(GObject.GPointer):
    """
    :Constructors:

    ::

        FontMapClass()
    """

    parent_class: GObject.ObjectClass = ...
    load_font: Callable[[FontMap, Context, FontDescription], Optional[Font]] = ...
    list_families: Callable[[FontMap], list[FontFamily]] = ...
    load_fontset: Callable[
        [FontMap, Context, FontDescription, Language], Optional[Fontset]
    ] = ...
    shape_engine_type: str = ...
    get_serial: Callable[[FontMap], int] = ...
    changed: Callable[[FontMap], None] = ...
    get_family: Callable[[FontMap, str], FontFamily] = ...
    get_face: None = ...

class FontMetrics(GObject.GBoxed):
    """
    :Constructors:

    ::

        FontMetrics()
    """

    ref_count: int = ...
    ascent: int = ...
    descent: int = ...
    height: int = ...
    approximate_char_width: int = ...
    approximate_digit_width: int = ...
    underline_position: int = ...
    underline_thickness: int = ...
    strikethrough_position: int = ...
    strikethrough_thickness: int = ...
    def get_approximate_char_width(self) -> int: ...
    def get_approximate_digit_width(self) -> int: ...
    def get_ascent(self) -> int: ...
    def get_descent(self) -> int: ...
    def get_height(self) -> int: ...
    def get_strikethrough_position(self) -> int: ...
    def get_strikethrough_thickness(self) -> int: ...
    def get_underline_position(self) -> int: ...
    def get_underline_thickness(self) -> int: ...
    def ref(self) -> Optional[FontMetrics]: ...
    def unref(self) -> None: ...

class Fontset(GObject.Object):
    """
    :Constructors:

    ::

        Fontset(**properties)

    Object PangoFontset

    Signals from GObject:
      notify (GParam)
    """

    parent_instance: GObject.Object = ...
    def do_foreach(self, func: Callable[..., bool], *data: Any) -> None: ...
    def do_get_font(self, wc: int) -> Font: ...
    def do_get_language(self) -> Language: ...
    def do_get_metrics(self) -> FontMetrics: ...
    def foreach(self, func: Callable[..., bool], *data: Any) -> None: ...
    def get_font(self, wc: int) -> Font: ...
    def get_metrics(self) -> FontMetrics: ...

class FontsetClass(GObject.GPointer):
    """
    :Constructors:

    ::

        FontsetClass()
    """

    parent_class: GObject.ObjectClass = ...
    get_font: Callable[[Fontset, int], Font] = ...
    get_metrics: Callable[[Fontset], FontMetrics] = ...
    get_language: Callable[[Fontset], Language] = ...
    foreach: Callable[..., None] = ...
    _pango_reserved1: None = ...
    _pango_reserved2: None = ...
    _pango_reserved3: None = ...
    _pango_reserved4: None = ...

class FontsetSimple(Fontset):
    """
    :Constructors:

    ::

        FontsetSimple(**properties)
        new(language:Pango.Language) -> Pango.FontsetSimple

    Object PangoFontsetSimple

    Signals from GObject:
      notify (GParam)
    """

    def append(self, font: Font) -> None: ...
    @classmethod
    def new(cls, language: Language) -> FontsetSimple: ...
    def size(self) -> int: ...

class FontsetSimpleClass(GObject.GPointer): ...

class GlyphGeometry(GObject.GPointer):
    """
    :Constructors:

    ::

        GlyphGeometry()
    """

    width: int = ...
    x_offset: int = ...
    y_offset: int = ...

class GlyphInfo(GObject.GPointer):
    """
    :Constructors:

    ::

        GlyphInfo()
    """

    glyph: int = ...
    geometry: GlyphGeometry = ...
    attr: GlyphVisAttr = ...

class GlyphItem(GObject.GBoxed):
    """
    :Constructors:

    ::

        GlyphItem()
    """

    item: Item = ...
    glyphs: GlyphString = ...
    y_offset: int = ...
    start_x_offset: int = ...
    end_x_offset: int = ...
    def apply_attrs(self, text: str, list: AttrList) -> list[GlyphItem]: ...
    def copy(self) -> Optional[GlyphItem]: ...
    def free(self) -> None: ...
    def get_logical_widths(self, text: str, logical_widths: Sequence[int]) -> None: ...
    def letter_space(
        self, text: str, log_attrs: Sequence[LogAttr], letter_spacing: int
    ) -> None: ...
    def split(self, text: str, split_index: int) -> Optional[GlyphItem]: ...

class GlyphItemIter(GObject.GBoxed):
    """
    :Constructors:

    ::

        GlyphItemIter()
    """

    glyph_item: GlyphItem = ...
    text: str = ...
    start_glyph: int = ...
    start_index: int = ...
    start_char: int = ...
    end_glyph: int = ...
    end_index: int = ...
    end_char: int = ...
    def copy(self) -> Optional[GlyphItemIter]: ...
    def free(self) -> None: ...
    def init_end(self, glyph_item: GlyphItem, text: str) -> bool: ...
    def init_start(self, glyph_item: GlyphItem, text: str) -> bool: ...
    def next_cluster(self) -> bool: ...
    def prev_cluster(self) -> bool: ...

class GlyphString(GObject.GBoxed):
    """
    :Constructors:

    ::

        GlyphString()
        new() -> Pango.GlyphString
    """

    num_glyphs: int = ...
    glyphs: list[GlyphInfo] = ...
    log_clusters: int = ...
    space: int = ...
    def copy(self) -> Optional[GlyphString]: ...
    def extents(self, font: Font) -> Tuple[Rectangle, Rectangle]: ...
    def extents_range(
        self, start: int, end: int, font: Font
    ) -> Tuple[Rectangle, Rectangle]: ...
    def free(self) -> None: ...
    def get_logical_widths(
        self,
        text: str,
        length: int,
        embedding_level: int,
        logical_widths: Sequence[int],
    ) -> None: ...
    def get_width(self) -> int: ...
    def index_to_x(
        self, text: str, length: int, analysis: Analysis, index_: int, trailing: bool
    ) -> int: ...
    def index_to_x_full(
        self,
        text: str,
        length: int,
        analysis: Analysis,
        attrs: Optional[LogAttr],
        index_: int,
        trailing: bool,
    ) -> int: ...
    @classmethod
    def new(cls) -> GlyphString: ...
    def set_size(self, new_len: int) -> None: ...
    def x_to_index(
        self, text: str, length: int, analysis: Analysis, x_pos: int
    ) -> Tuple[int, int]: ...

class GlyphVisAttr(GObject.GPointer):
    """
    :Constructors:

    ::

        GlyphVisAttr()
    """

    is_cluster_start: int = ...
    is_color: int = ...

class Item(GObject.GBoxed):
    """
    :Constructors:

    ::

        Item()
        new() -> Pango.Item
    """

    offset: int = ...
    length: int = ...
    num_chars: int = ...
    analysis: Analysis = ...
    def apply_attrs(self, iter: AttrIterator) -> None: ...
    def copy(self) -> Optional[Item]: ...
    def free(self) -> None: ...
    def get_char_offset(self) -> int: ...
    @classmethod
    def new(cls) -> Item: ...
    def split(self, split_index: int, split_offset: int) -> Item: ...

class Language(GObject.GBoxed):
    @staticmethod
    def from_string(language: Optional[str] = None) -> Optional[Language]: ...
    @staticmethod
    def get_default() -> Language: ...
    @staticmethod
    def get_preferred() -> Optional[list[Language]]: ...
    def get_sample_string(self) -> str: ...
    def get_scripts(self) -> Optional[list[Script]]: ...
    def includes_script(self, script: Script) -> bool: ...
    def matches(self, range_list: str) -> bool: ...
    def to_string(self) -> str: ...

class Layout(GObject.Object):
    """
    :Constructors:

    ::

        Layout(**properties)
        new(context:Pango.Context) -> Pango.Layout

    Object PangoLayout

    Signals from GObject:
      notify (GParam)
    """

    def context_changed(self) -> None: ...
    def copy(self) -> Layout: ...
    @staticmethod
    def deserialize(
        context: Context, bytes: GLib.Bytes, flags: LayoutDeserializeFlags
    ) -> Optional[Layout]: ...
    def get_alignment(self) -> Alignment: ...
    def get_attributes(self) -> Optional[AttrList]: ...
    def get_auto_dir(self) -> bool: ...
    def get_baseline(self) -> int: ...
    def get_caret_pos(self, index_: int) -> Tuple[Rectangle, Rectangle]: ...
    def get_character_count(self) -> int: ...
    def get_context(self) -> Context: ...
    def get_cursor_pos(self, index_: int) -> Tuple[Rectangle, Rectangle]: ...
    def get_direction(self, index: int) -> Direction: ...
    def get_ellipsize(self) -> EllipsizeMode: ...
    def get_extents(self) -> Tuple[Rectangle, Rectangle]: ...
    def get_font_description(self) -> Optional[FontDescription]: ...
    def get_height(self) -> int: ...
    def get_indent(self) -> int: ...
    def get_iter(self) -> LayoutIter: ...
    def get_justify(self) -> bool: ...
    def get_justify_last_line(self) -> bool: ...
    def get_line(self, line: int) -> Optional[LayoutLine]: ...
    def get_line_count(self) -> int: ...
    def get_line_readonly(self, line: int) -> Optional[LayoutLine]: ...
    def get_line_spacing(self) -> float: ...
    def get_lines(self) -> list[LayoutLine]: ...
    def get_lines_readonly(self) -> list[LayoutLine]: ...
    def get_log_attrs(self) -> list[LogAttr]: ...
    def get_log_attrs_readonly(self) -> list[LogAttr]: ...
    def get_pixel_extents(self) -> Tuple[Rectangle, Rectangle]: ...
    def get_pixel_size(self) -> Tuple[int, int]: ...
    def get_serial(self) -> int: ...
    def get_single_paragraph_mode(self) -> bool: ...
    def get_size(self) -> Tuple[int, int]: ...
    def get_spacing(self) -> int: ...
    def get_tabs(self) -> Optional[TabArray]: ...
    def get_text(self) -> str: ...
    def get_unknown_glyphs_count(self) -> int: ...
    def get_width(self) -> int: ...
    def get_wrap(self) -> WrapMode: ...
    def index_to_line_x(self, index_: int, trailing: bool) -> Tuple[int, int]: ...
    def index_to_pos(self, index_: int) -> Rectangle: ...
    def is_ellipsized(self) -> bool: ...
    def is_wrapped(self) -> bool: ...
    def move_cursor_visually(
        self, strong: bool, old_index: int, old_trailing: int, direction: int
    ) -> Tuple[int, int]: ...
    @classmethod
    def new(cls, context: Context) -> Layout: ...
    def serialize(self, flags: LayoutSerializeFlags) -> GLib.Bytes: ...
    def set_alignment(self, alignment: Alignment) -> None: ...
    def set_attributes(self, attrs: Optional[AttrList] = None) -> None: ...
    def set_auto_dir(self, auto_dir: bool) -> None: ...
    def set_ellipsize(self, ellipsize: EllipsizeMode) -> None: ...
    def set_font_description(self, desc: Optional[FontDescription] = None) -> None: ...
    def set_height(self, height: int) -> None: ...
    def set_indent(self, indent: int) -> None: ...
    def set_justify(self, justify: bool) -> None: ...
    def set_justify_last_line(self, justify: bool) -> None: ...
    def set_line_spacing(self, factor: float) -> None: ...
    def set_markup(self, text, length=-1): ...  # FIXME Function
    def set_markup_with_accel(
        self, markup: str, length: int, accel_marker: str
    ) -> str: ...
    def set_single_paragraph_mode(self, setting: bool) -> None: ...
    def set_spacing(self, spacing: int) -> None: ...
    def set_tabs(self, tabs: Optional[TabArray] = None) -> None: ...
    # override
    def set_text(self, text: str, length=-1) -> None: ...
    def set_width(self, width: int) -> None: ...
    def set_wrap(self, wrap: WrapMode) -> None: ...
    def write_to_file(self, flags: LayoutSerializeFlags, filename: str) -> bool: ...
    def xy_to_index(self, x: int, y: int) -> Tuple[bool, int, int]: ...

class LayoutClass(GObject.GPointer): ...

class LayoutIter(GObject.GBoxed):
    def at_last_line(self) -> bool: ...
    def copy(self) -> Optional[LayoutIter]: ...
    def free(self) -> None: ...
    def get_baseline(self) -> int: ...
    def get_char_extents(self) -> Rectangle: ...
    def get_cluster_extents(self) -> Tuple[Rectangle, Rectangle]: ...
    def get_index(self) -> int: ...
    def get_layout(self) -> Optional[Layout]: ...
    def get_layout_extents(self) -> Tuple[Rectangle, Rectangle]: ...
    def get_line(self) -> Optional[LayoutLine]: ...
    def get_line_extents(self) -> Tuple[Rectangle, Rectangle]: ...
    def get_line_readonly(self) -> Optional[LayoutLine]: ...
    def get_line_yrange(self) -> Tuple[int, int]: ...
    def get_run(self) -> Optional[GlyphItem]: ...
    def get_run_baseline(self) -> int: ...
    def get_run_extents(self) -> Tuple[Rectangle, Rectangle]: ...
    def get_run_readonly(self) -> Optional[GlyphItem]: ...
    def next_char(self) -> bool: ...
    def next_cluster(self) -> bool: ...
    def next_line(self) -> bool: ...
    def next_run(self) -> bool: ...

class LayoutLine(GObject.GBoxed):
    """
    :Constructors:

    ::

        LayoutLine()
    """

    layout: Layout = ...
    start_index: int = ...
    length: int = ...
    runs: list[GlyphItem] = ...
    is_paragraph_start: int = ... # type: ignore[misc]
    resolved_dir: int = ...
    def get_extents(self) -> Tuple[Rectangle, Rectangle]: ...
    def get_height(self) -> int: ...
    def get_length(self) -> int: ...
    def get_pixel_extents(self) -> Tuple[Rectangle, Rectangle]: ...
    def get_resolved_direction(self) -> Direction: ...
    def get_start_index(self) -> int: ...
    def get_x_ranges(self, start_index: int, end_index: int) -> list[int]: ...
    def index_to_x(self, index_: int, trailing: bool) -> int: ...
    def is_paragraph_start(self) -> bool: ...
    def ref(self) -> Optional[LayoutLine]: ...
    def unref(self) -> None: ...
    def x_to_index(self, x_pos: int) -> Tuple[bool, int, int]: ...

class LogAttr(GObject.GPointer):
    """
    :Constructors:

    ::

        LogAttr()
    """

    is_line_break: int = ...
    is_mandatory_break: int = ...
    is_char_break: int = ...
    is_white: int = ...
    is_cursor_position: int = ...
    is_word_start: int = ...
    is_word_end: int = ...
    is_sentence_boundary: int = ...
    is_sentence_start: int = ...
    is_sentence_end: int = ...
    backspace_deletes_character: int = ...
    is_expandable_space: int = ...
    is_word_boundary: int = ...
    break_inserts_hyphen: int = ...
    break_removes_preceding: int = ...
    reserved: int = ...

class Matrix(GObject.GBoxed):
    """
    :Constructors:

    ::

        Matrix()
    """

    xx: float = ...
    xy: float = ...
    yx: float = ...
    yy: float = ...
    x0: float = ...
    y0: float = ...
    def concat(self, new_matrix: Matrix) -> None: ...
    def copy(self) -> Optional[Matrix]: ...
    def free(self) -> None: ...
    def get_font_scale_factor(self) -> float: ...
    def get_font_scale_factors(self) -> Tuple[float, float]: ...
    def get_slant_ratio(self) -> float: ...
    def rotate(self, degrees: float) -> None: ...
    def scale(self, scale_x: float, scale_y: float) -> None: ...
    def transform_distance(self) -> Tuple[float, float]: ...
    def transform_pixel_rectangle(self) -> Rectangle: ...
    def transform_point(self) -> Tuple[float, float]: ...
    def transform_rectangle(self) -> Rectangle: ...
    def translate(self, tx: float, ty: float) -> None: ...

class Rectangle(GObject.GPointer):
    """
    :Constructors:

    ::

        Rectangle()
    """

    x: int = ...
    y: int = ...
    width: int = ...
    height: int = ...

class Renderer(GObject.Object):
    """
    :Constructors:

    ::

        Renderer(**properties)

    Object PangoRenderer

    Signals from GObject:
      notify (GParam)
    """

    parent_instance: GObject.Object = ...
    underline: Underline = ...
    strikethrough: bool = ...
    active_count: int = ...
    matrix: Matrix = ...
    priv: RendererPrivate = ...
    def activate(self) -> None: ...
    def deactivate(self) -> None: ...
    def do_begin(self) -> None: ...
    def do_draw_error_underline(
        self, x: int, y: int, width: int, height: int
    ) -> None: ...
    def do_draw_glyph(self, font: Font, glyph: int, x: float, y: float) -> None: ...
    def do_draw_glyph_item(
        self, text: Optional[str], glyph_item: GlyphItem, x: int, y: int
    ) -> None: ...
    def do_draw_glyphs(
        self, font: Font, glyphs: GlyphString, x: int, y: int
    ) -> None: ...
    def do_draw_rectangle(
        self, part: RenderPart, x: int, y: int, width: int, height: int
    ) -> None: ...
    def do_draw_shape(self, attr: AttrShape, x: int, y: int) -> None: ...
    def do_draw_trapezoid(
        self,
        part: RenderPart,
        y1_: float,
        x11: float,
        x21: float,
        y2: float,
        x12: float,
        x22: float,
    ) -> None: ...
    def do_end(self) -> None: ...
    def do_part_changed(self, part: RenderPart) -> None: ...
    def do_prepare_run(self, run: GlyphItem) -> None: ...
    def draw_error_underline(self, x: int, y: int, width: int, height: int) -> None: ...
    def draw_glyph(self, font: Font, glyph: int, x: float, y: float) -> None: ...
    def draw_glyph_item(
        self, text: Optional[str], glyph_item: GlyphItem, x: int, y: int
    ) -> None: ...
    def draw_glyphs(self, font: Font, glyphs: GlyphString, x: int, y: int) -> None: ...
    def draw_layout(self, layout: Layout, x: int, y: int) -> None: ...
    def draw_layout_line(self, line: LayoutLine, x: int, y: int) -> None: ...
    def draw_rectangle(
        self, part: RenderPart, x: int, y: int, width: int, height: int
    ) -> None: ...
    def draw_trapezoid(
        self,
        part: RenderPart,
        y1_: float,
        x11: float,
        x21: float,
        y2: float,
        x12: float,
        x22: float,
    ) -> None: ...
    def get_alpha(self, part: RenderPart) -> int: ...
    def get_color(self, part: RenderPart) -> Optional[Color]: ...
    def get_layout(self) -> Optional[Layout]: ...
    def get_layout_line(self) -> Optional[LayoutLine]: ...
    def get_matrix(self) -> Optional[Matrix]: ...
    def part_changed(self, part: RenderPart) -> None: ...
    def set_alpha(self, part: RenderPart, alpha: int) -> None: ...
    def set_color(self, part: RenderPart, color: Optional[Color] = None) -> None: ...
    def set_matrix(self, matrix: Optional[Matrix] = None) -> None: ...

class RendererClass(GObject.GPointer):
    """
    :Constructors:

    ::

        RendererClass()
    """

    parent_class: GObject.ObjectClass = ...
    draw_glyphs: Callable[[Renderer, Font, GlyphString, int, int], None] = ...
    draw_rectangle: Callable[[Renderer, RenderPart, int, int, int, int], None] = ...
    draw_error_underline: Callable[[Renderer, int, int, int, int], None] = ...
    draw_shape: Callable[[Renderer, AttrShape, int, int], None] = ...
    draw_trapezoid: Callable[
        [Renderer, RenderPart, float, float, float, float, float, float], None
    ] = ...
    draw_glyph: Callable[[Renderer, Font, int, float, float], None] = ...
    part_changed: Callable[[Renderer, RenderPart], None] = ...
    begin: Callable[[Renderer], None] = ...
    end: Callable[[Renderer], None] = ...
    prepare_run: Callable[[Renderer, GlyphItem], None] = ...
    draw_glyph_item: Callable[[Renderer, Optional[str], GlyphItem, int, int], None] = (
        ...
    )
    _pango_reserved2: None = ...
    _pango_reserved3: None = ...
    _pango_reserved4: None = ...

class RendererPrivate(GObject.GPointer): ...

class ScriptIter(GObject.GBoxed):
    """
    :Constructors:

    ::

        new(text:str, length:int) -> Pango.ScriptIter
    """

    def free(self) -> None: ...
    def get_range(self) -> Tuple[str, str, Script]: ...
    @classmethod
    def new(cls, text: str, length: int) -> ScriptIter: ...
    def next(self) -> bool: ...

class TabArray(GObject.GBoxed):
    """
    :Constructors:

    ::

        new(initial_size:int, positions_in_pixels:bool) -> Pango.TabArray
    """

    def copy(self) -> TabArray: ...
    def free(self) -> None: ...
    @staticmethod
    def from_string(text: str) -> Optional[TabArray]: ...
    def get_decimal_point(self, tab_index: int) -> str: ...
    def get_positions_in_pixels(self) -> bool: ...
    def get_size(self) -> int: ...
    def get_tab(self, tab_index: int) -> Tuple[TabAlign, int]: ...
    def get_tabs(self) -> Tuple[TabAlign, list[int]]: ...
    @classmethod
    def new(cls, initial_size: int, positions_in_pixels: bool) -> TabArray: ...
    def resize(self, new_size: int) -> None: ...
    def set_decimal_point(self, tab_index: int, decimal_point: str) -> None: ...
    def set_positions_in_pixels(self, positions_in_pixels: bool) -> None: ...
    def set_tab(self, tab_index: int, alignment: TabAlign, location: int) -> None: ...
    def sort(self) -> None: ...
    def to_string(self) -> str: ...

class FontMask(GObject.GFlags):
    FAMILY = 1
    GRAVITY = 64
    SIZE = 32
    STRETCH = 16
    STYLE = 2
    VARIANT = 4
    VARIATIONS = 128
    WEIGHT = 8

class LayoutDeserializeFlags(GObject.GFlags):
    CONTEXT = 1
    DEFAULT = 0

class LayoutSerializeFlags(GObject.GFlags):
    CONTEXT = 1
    DEFAULT = 0
    OUTPUT = 2

class ShapeFlags(GObject.GFlags):
    NONE = 0
    ROUND_POSITIONS = 1

class ShowFlags(GObject.GFlags):
    IGNORABLES = 4
    LINE_BREAKS = 2
    NONE = 0
    SPACES = 1

class Alignment(GObject.GEnum):
    CENTER = 1
    LEFT = 0
    RIGHT = 2

class AttrType(GObject.GEnum):
    ABSOLUTE_LINE_HEIGHT = 32
    ABSOLUTE_SIZE = 20
    ALLOW_BREAKS = 26
    BACKGROUND = 10
    BACKGROUND_ALPHA = 25
    BASELINE_SHIFT = 36
    FALLBACK = 16
    FAMILY = 2
    FONT_DESC = 8
    FONT_FEATURES = 23
    FONT_SCALE = 37
    FOREGROUND = 9
    FOREGROUND_ALPHA = 24
    GRAVITY = 21
    GRAVITY_HINT = 22
    INSERT_HYPHENS = 28
    INVALID = 0
    LANGUAGE = 1
    LETTER_SPACING = 17
    LINE_HEIGHT = 31
    OVERLINE = 29
    OVERLINE_COLOR = 30
    RISE = 13
    SCALE = 15
    SENTENCE = 35
    SHAPE = 14
    SHOW = 27
    SIZE = 7
    STRETCH = 6
    STRIKETHROUGH = 12
    STRIKETHROUGH_COLOR = 19
    STYLE = 3
    TEXT_TRANSFORM = 33
    UNDERLINE = 11
    UNDERLINE_COLOR = 18
    VARIANT = 5
    WEIGHT = 4
    WORD = 34
    @staticmethod
    def get_name(type: AttrType) -> Optional[str]: ...
    @staticmethod
    def register(name: str) -> AttrType: ...

class BaselineShift(GObject.GEnum):
    NONE = 0
    SUBSCRIPT = 2
    SUPERSCRIPT = 1

class BidiType(GObject.GEnum):
    AL = 4
    AN = 11
    B = 15
    BN = 14
    CS = 12
    EN = 8
    ES = 9
    ET = 10
    FSI = 21
    L = 0
    LRE = 1
    LRI = 19
    LRO = 2
    NSM = 13
    ON = 18
    PDF = 7
    PDI = 22
    R = 3
    RLE = 5
    RLI = 20
    RLO = 6
    S = 16
    WS = 17
    @staticmethod
    def for_unichar(ch: str) -> BidiType: ...

class CoverageLevel(GObject.GEnum):
    APPROXIMATE = 2
    EXACT = 3
    FALLBACK = 1
    NONE = 0

class Direction(GObject.GEnum):
    LTR = 0
    NEUTRAL = 6
    RTL = 1
    TTB_LTR = 2
    TTB_RTL = 3
    WEAK_LTR = 4
    WEAK_RTL = 5

class EllipsizeMode(GObject.GEnum):
    END = 3
    MIDDLE = 2
    NONE = 0
    START = 1

class FontScale(GObject.GEnum):
    NONE = 0
    SMALL_CAPS = 3
    SUBSCRIPT = 2
    SUPERSCRIPT = 1

class Gravity(GObject.GEnum):
    AUTO = 4
    EAST = 1
    NORTH = 2
    SOUTH = 0
    WEST = 3
    @staticmethod
    def get_for_matrix(matrix: Optional[Matrix] = None) -> Gravity: ...
    @staticmethod
    def get_for_script(
        script: Script, base_gravity: Gravity, hint: GravityHint
    ) -> Gravity: ...
    @staticmethod
    def get_for_script_and_width(
        script: Script, wide: bool, base_gravity: Gravity, hint: GravityHint
    ) -> Gravity: ...
    @staticmethod
    def to_rotation(gravity: Gravity) -> float: ...

class GravityHint(GObject.GEnum):
    LINE = 2
    NATURAL = 0
    STRONG = 1

class LayoutDeserializeError(GObject.GEnum):
    INVALID = 0
    INVALID_VALUE = 1
    MISSING_VALUE = 2
    @staticmethod
    def quark() -> int: ...

class Overline(GObject.GEnum):
    NONE = 0
    SINGLE = 1

class RenderPart(GObject.GEnum):
    BACKGROUND = 1
    FOREGROUND = 0
    OVERLINE = 4
    STRIKETHROUGH = 3
    UNDERLINE = 2

class Script(GObject.GEnum):
    AHOM = 111
    ANATOLIAN_HIEROGLYPHS = 112
    ARABIC = 2
    ARMENIAN = 3
    BALINESE = 62
    BASSA_VAH = 88
    BATAK = 78
    BENGALI = 4
    BOPOMOFO = 5
    BRAHMI = 79
    BRAILLE = 46
    BUGINESE = 55
    BUHID = 44
    CANADIAN_ABORIGINAL = 40
    CARIAN = 75
    CAUCASIAN_ALBANIAN = 89
    CHAKMA = 81
    CHAM = 72
    CHEROKEE = 6
    COMMON = 0
    COPTIC = 7
    CUNEIFORM = 63
    CYPRIOT = 47
    CYRILLIC = 8
    DESERET = 9
    DEVANAGARI = 10
    DUPLOYAN = 90
    ELBASAN = 91
    ETHIOPIC = 11
    GEORGIAN = 12
    GLAGOLITIC = 56
    GOTHIC = 13
    GRANTHA = 92
    GREEK = 14
    GUJARATI = 15
    GURMUKHI = 16
    HAN = 17
    HANGUL = 18
    HANUNOO = 43
    HATRAN = 113
    HEBREW = 19
    HIRAGANA = 20
    INHERITED = 1
    INVALID_CODE = -1
    KANNADA = 21
    KATAKANA = 22
    KAYAH_LI = 67
    KHAROSHTHI = 60
    KHMER = 23
    KHOJKI = 93
    KHUDAWADI = 94
    LAO = 24
    LATIN = 25
    LEPCHA = 68
    LIMBU = 48
    LINEAR_A = 95
    LINEAR_B = 51
    LYCIAN = 76
    LYDIAN = 77
    MAHAJANI = 96
    MALAYALAM = 26
    MANDAIC = 80
    MANICHAEAN = 97
    MENDE_KIKAKUI = 98
    MEROITIC_CURSIVE = 82
    MEROITIC_HIEROGLYPHS = 83
    MIAO = 84
    MODI = 99
    MONGOLIAN = 27
    MRO = 100
    MULTANI = 114
    MYANMAR = 28
    NABATAEAN = 101
    NEW_TAI_LUE = 54
    NKO = 66
    OGHAM = 29
    OLD_HUNGARIAN = 115
    OLD_ITALIC = 30
    OLD_NORTH_ARABIAN = 102
    OLD_PERMIC = 103
    OLD_PERSIAN = 59
    OL_CHIKI = 73
    ORIYA = 31
    OSMANYA = 49
    PAHAWH_HMONG = 104
    PALMYRENE = 105
    PAU_CIN_HAU = 106
    PHAGS_PA = 65
    PHOENICIAN = 64
    PSALTER_PAHLAVI = 107
    REJANG = 69
    RUNIC = 32
    SAURASHTRA = 71
    SHARADA = 85
    SHAVIAN = 50
    SIDDHAM = 108
    SIGNWRITING = 116
    SINHALA = 33
    SORA_SOMPENG = 86
    SUNDANESE = 70
    SYLOTI_NAGRI = 58
    SYRIAC = 34
    TAGALOG = 42
    TAGBANWA = 45
    TAI_LE = 52
    TAKRI = 87
    TAMIL = 35
    TELUGU = 36
    THAANA = 37
    THAI = 38
    TIBETAN = 39
    TIFINAGH = 57
    TIRHUTA = 109
    UGARITIC = 53
    UNKNOWN = 61
    VAI = 74
    WARANG_CITI = 110
    YI = 41
    @staticmethod
    def for_unichar(ch: str) -> Script: ...
    @staticmethod
    def get_sample_language(script: Script) -> Optional[Language]: ...

class Stretch(GObject.GEnum): # type: ignore[misc]
    CONDENSED = 2
    EXPANDED = 6
    EXTRA_CONDENSED = 1
    EXTRA_EXPANDED = 7
    NORMAL = 4
    SEMI_CONDENSED = 3
    SEMI_EXPANDED = 5
    ULTRA_CONDENSED = 0
    ULTRA_EXPANDED = 8

class Style(GObject.GEnum): # type: ignore[misc]
    ITALIC = 2
    NORMAL = 0
    OBLIQUE = 1

class TabAlign(GObject.GEnum): # type: ignore[misc]
    CENTER = 2
    DECIMAL = 3
    LEFT = 0
    RIGHT = 1

class TextTransform(GObject.GEnum): # type: ignore[misc]
    CAPITALIZE = 3
    LOWERCASE = 1
    NONE = 0
    UPPERCASE = 2

class Underline(GObject.GEnum): # type: ignore[misc]
    DOUBLE = 2
    DOUBLE_LINE = 6
    ERROR = 4
    ERROR_LINE = 7
    LOW = 3
    NONE = 0
    SINGLE = 1
    SINGLE_LINE = 5

class Variant(GObject.GEnum): # type: ignore[misc]
    ALL_PETITE_CAPS = 4
    ALL_SMALL_CAPS = 2
    NORMAL = 0
    PETITE_CAPS = 3
    SMALL_CAPS = 1
    TITLE_CAPS = 6
    UNICASE = 5

class Weight(GObject.GEnum): # type: ignore[misc]
    BOLD = 700
    BOOK = 380
    HEAVY = 900
    LIGHT = 300
    MEDIUM = 500
    NORMAL = 400
    SEMIBOLD = 600
    SEMILIGHT = 350
    THIN = 100
    ULTRABOLD = 800
    ULTRAHEAVY = 1000
    ULTRALIGHT = 200

class WrapMode(GObject.GEnum): # type: ignore[misc]
    CHAR = 1
    WORD = 0
    WORD_CHAR = 2

    BATAK = 78
    BENGALI = 4
    BOPOMOFO = 5
    BRAHMI = 79
    BRAILLE = 46
    BUGINESE = 55
    BUHID = 44
    CANADIAN_ABORIGINAL = 40
    CARIAN = 75
    CAUCASIAN_ALBANIAN = 89
    CHAKMA = 81
    CHAM = 72
    CHEROKEE = 6
    COMMON = 0
    COPTIC = 7
    CUNEIFORM = 63
    CYPRIOT = 47
    CYRILLIC = 8
    DESERET = 9
    DEVANAGARI = 10
    DUPLOYAN = 90
    ELBASAN = 91
    ETHIOPIC = 11
    GEORGIAN = 12
    GLAGOLITIC = 56
    GOTHIC = 13
    GRANTHA = 92
    GREEK = 14
    GUJARATI = 15
    GURMUKHI = 16
    HAN = 17
    HANGUL = 18
    HANUNOO = 43
    HATRAN = 113
    HEBREW = 19
    HIRAGANA = 20
    INHERITED = 1
    INVALID_CODE = -1
    KANNADA = 21
    KATAKANA = 22
    KAYAH_LI = 67
    KHAROSHTHI = 60
    KHMER = 23
    KHOJKI = 93
    KHUDAWADI = 94
    LAO = 24
    LATIN = 25
    LEPCHA = 68
    LIMBU = 48
    LINEAR_A = 95
    LINEAR_B = 51
    LYCIAN = 76
    LYDIAN = 77
    MAHAJANI = 96
    MALAYALAM = 26
    MANDAIC = 80
    MANICHAEAN = 97
    MENDE_KIKAKUI = 98
    MEROITIC_CURSIVE = 82
    MEROITIC_HIEROGLYPHS = 83
    MIAO = 84
    MODI = 99
    MONGOLIAN = 27
    MRO = 100
    MULTANI = 114
    MYANMAR = 28
    NABATAEAN = 101
    NEW_TAI_LUE = 54
    NKO = 66
    OGHAM = 29
    OLD_HUNGARIAN = 115
    OLD_ITALIC = 30
    OLD_NORTH_ARABIAN = 102
    OLD_PERMIC = 103
    OLD_PERSIAN = 59
    OL_CHIKI = 73
    ORIYA = 31
    OSMANYA = 49
    PAHAWH_HMONG = 104
    PALMYRENE = 105
    PAU_CIN_HAU = 106
    PHAGS_PA = 65
    PHOENICIAN = 64
    PSALTER_PAHLAVI = 107
    REJANG = 69
    RUNIC = 32
    SAURASHTRA = 71
    SHARADA = 85
    SHAVIAN = 50
    SIDDHAM = 108
    SIGNWRITING = 116
    SINHALA = 33
    SORA_SOMPENG = 86
    SUNDANESE = 70
    SYLOTI_NAGRI = 58
    SYRIAC = 34
    TAGALOG = 42
    TAGBANWA = 45
    TAI_LE = 52
    TAKRI = 87
    TAMIL = 35
    TELUGU = 36
    THAANA = 37
    THAI = 38
    TIBETAN = 39
    TIFINAGH = 57
    TIRHUTA = 109
    UGARITIC = 53
    UNKNOWN = 61
    VAI = 74
    WARANG_CITI = 110
    YI = 41
    @staticmethod
    def for_unichar(ch: str) -> Script: ...
    @staticmethod
    def get_sample_language(script: Script) -> Optional[Language]: ...

class Stretch(GObject.GEnum):
    CONDENSED = 2
    EXPANDED = 6
    EXTRA_CONDENSED = 1
    EXTRA_EXPANDED = 7
    NORMAL = 4
    SEMI_CONDENSED = 3
    SEMI_EXPANDED = 5
    ULTRA_CONDENSED = 0
    ULTRA_EXPANDED = 8

class Style(GObject.GEnum):
    ITALIC = 2
    NORMAL = 0
    OBLIQUE = 1

class TabAlign(GObject.GEnum):
    CENTER = 2
    DECIMAL = 3
    LEFT = 0
    RIGHT = 1

class TextTransform(GObject.GEnum):
    CAPITALIZE = 3
    LOWERCASE = 1
    NONE = 0
    UPPERCASE = 2

class Underline(GObject.GEnum):
    DOUBLE = 2
    DOUBLE_LINE = 6
    ERROR = 4
    ERROR_LINE = 7
    LOW = 3
    NONE = 0
    SINGLE = 1
    SINGLE_LINE = 5

class Variant(GObject.GEnum):
    ALL_PETITE_CAPS = 4
    ALL_SMALL_CAPS = 2
    NORMAL = 0
    PETITE_CAPS = 3
    SMALL_CAPS = 1
    TITLE_CAPS = 6
    UNICASE = 5

class Weight(GObject.GEnum):
    BOLD = 700
    BOOK = 380
    HEAVY = 900
    LIGHT = 300
    MEDIUM = 500
    NORMAL = 400
    SEMIBOLD = 600
    SEMILIGHT = 350
    THIN = 100
    ULTRABOLD = 800
    ULTRAHEAVY = 1000
    ULTRALIGHT = 200

class WrapMode(GObject.GEnum):
    CHAR = 1
    WORD = 0
    WORD_CHAR = 2
